// pages/topListInfo/topListInfo.js

import { Base } from '../../../utils/base.js'

import { Home } from 'topListInfo-model.js'
var home = new Home();

var WxParse =require("../../../wxParse/wxParse.js")

Page({

  /**
   * 页面的初始数据
   */
  data: {
    topinfo:null,
    infoHtml:''
  },
  onLoad: function (options) {
    console.log(options.id)
    this.setData({ "id": options.id})
    this._getData(options.id);
    
  },
  _getData(id){
    var data = home.getList(id,(res)=>{
      console.log(res)
      this.setData({
        "musicList": res.songlist
      })
      this.setData({
        topinfo: res,
        //musicList: res.songlist
      })
      var article = res.topinfo.info;
      WxParse.wxParse('article', 'html', article, this, 5);
    })
  }
})